/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Vista.Ventanas.Movimientos;

import Logica.Core.PersonaLegal.Cliente;
import Vista.Controladoras.ControladoraVista;
import Vista.Herramientas.CajaDeHerramientas;
import java.text.SimpleDateFormat;
import java.util.List;
import javax.swing.DefaultListModel;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Luciano
 */
public class ABMMovimientos extends javax.swing.JInternalFrame {

    protected CajaDeHerramientas misHerramientas;
    protected Cliente miCliente;
    protected ControladoraVista miControladora;
    protected boolean filaSeleccionada;
    private boolean[] goodToGo;

    /**
     * Creates new form ABMClientes
     */
    public ABMMovimientos(ControladoraVista miControladora) {
        inicializar(miControladora);
        initComponents();
        cargarTabla();
        cargarListas();
        inicializarLosCosos();
    }

    private void inicializar(ControladoraVista miControladora) {
        misHerramientas = new CajaDeHerramientas();
        this.miControladora = miControladora;
        goodToGo = new boolean[2];
    }

    private void cargarTabla() {
        Object[] misDatos;
        SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
        DefaultTableModel temp = (DefaultTableModel) tblCliente.getModel();

        List<Cliente> misClientes = miControladora.getMiVistaCliente().dameMisClientes();


        temp.setRowCount(0);
        temp.setColumnCount(8);



        for (int i = 0; i < misClientes.size(); i++) {

            misDatos = new Object[9];
            misDatos[0] = misClientes.get(i).getNroCliente();
            misDatos[1] = misClientes.get(i).getNombre();
            misDatos[2] = misClientes.get(i).getApellido();
            misDatos[3] = misClientes.get(i).getDni();
            misDatos[4] = sdf.format(misClientes.get(i).getFechaNacimiento());
            misDatos[5] = misClientes.get(i).getDireccion();
            misDatos[6] = misClientes.get(i).getTelefono();
            misDatos[7] = misClientes.get(i).getEmail();



            if (misClientes.get(i).isEstado()) {
                misDatos[8] = "Alta";
            } else {
                misDatos[8] = "Baja";
            }

            if (misClientes.get(i).isEstado()) {
                temp.addRow(misDatos);
            }
        }
        misHerramientas.getAutoAjustador().autoAjustar(tblCliente);
    }

    public void llenarCampos() {
        int i = tblCliente.getSelectedRow();
        if (i != -1) {
            for (int j = 0; j < 8; j++) {
                Object celda = tblCliente.getValueAt(i, j);
                if (celda != null) {
                    agregarAlCampo(j, celda.toString());
                }
            }
        }

    }

    private void agregarAlCampo(int indice, String celda) {
        switch (indice) {
            case 0:
                txtNroCliente.setText(celda);
                break;
            case 1:
                txtFecha.setText(celda);
                break;
            case 2:
                txtHora.setText(celda);
                break;

        }
    }

    private void vaciarCampos() {
        for (int j = 0; j < 12; j++) {
            agregarAlCampo(j, "");
        }
    }

    private boolean datosValidos(JTextField[] obligatorios) throws Exception {
        boolean ret = true;

        for (int i = 0; i < obligatorios.length && ret; i++) {
            if (obligatorios[i].getText().equals("")) {
                ret = false;
            }
        }

        if (!ret) {
            throw new Exception("Campos obligatorios vacios.");
        }

        return ret;
    }

    private JTextField[] camposObligatorios() {
        JTextField[] obligatorios = new JTextField[2];


        obligatorios[1] = txtFecha;


        return obligatorios;
    }

    private void cargarListas() {
        DefaultListModel dlm = new DefaultListModel();
       // miControladora.
     //   dlm.addElement(dlm);
    }

    private void inicializarLosCosos() {
        lblProductos.setVisible(false);
        scrollListProductos.setVisible(false);
        lblDestino.setVisible(false);
        txtDestino.setVisible(false);
        lblBascula.setVisible(true);
        btnNuevaBascula.setVisible(true);
        lblMatPrima.setVisible(true);
        btnNuevaMatPrima.setVisible(true);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        SecaderoPUEntityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("SecaderoPU").createEntityManager();
        buttonGroup1 = new javax.swing.ButtonGroup();
        panelTabla = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblCliente = new javax.swing.JTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        panelAlta = new javax.swing.JPanel();
        lblNroCliente = new javax.swing.JLabel();
        txtNroCliente = new javax.swing.JTextField();
        txtFecha = new javax.swing.JTextField();
        lblFecha = new javax.swing.JLabel();
        txtHora = new javax.swing.JTextField();
        lblHora = new javax.swing.JLabel();
        lblRodado = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        listRodado = new javax.swing.JList();
        jSeparator1 = new javax.swing.JSeparator();
        lblBascula = new javax.swing.JLabel();
        rdEntrada = new javax.swing.JRadioButton();
        rbSalida = new javax.swing.JRadioButton();
        lblMatPrima = new javax.swing.JLabel();
        lblDestino = new javax.swing.JLabel();
        lblProductos = new javax.swing.JLabel();
        btnNuevaBascula = new javax.swing.JButton();
        btnNuevaMatPrima = new javax.swing.JButton();
        txtDestino = new javax.swing.JTextField();
        scrollListProductos = new javax.swing.JScrollPane();
        listProductos = new javax.swing.JList();
        panelBotones = new javax.swing.JPanel();
        btnModificar = new javax.swing.JButton();
        btnAlta = new javax.swing.JButton();
        btnCancelarSeleccion = new javax.swing.JButton();

        tblCliente.setAutoCreateRowSorter(true);
        tblCliente.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "N° Cliente", "Nombre", "Apelldio", "DNI", "Fecha de Nacimiento", "Dirección", "Teléfono", "E-Mail"
            }
        ));
        tblCliente.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
        tblCliente.setColumnSelectionAllowed(true);
        tblCliente.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        tblCliente.getTableHeader().setResizingAllowed(false);
        tblCliente.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblClienteMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tblCliente);
        tblCliente.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);

        javax.swing.GroupLayout panelTablaLayout = new javax.swing.GroupLayout(panelTabla);
        panelTabla.setLayout(panelTablaLayout);
        panelTablaLayout.setHorizontalGroup(
            panelTablaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE)
        );
        panelTablaLayout.setVerticalGroup(
            panelTablaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 358, Short.MAX_VALUE)
        );

        jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        jScrollPane2.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
        jScrollPane2.setAutoscrolls(true);

        lblNroCliente.setText("nroMovimiento");

        txtNroCliente.setEditable(false);
        txtNroCliente.setColumns(10);
        txtNroCliente.setText("<Autogenerado>");

        txtFecha.setColumns(10);
        txtFecha.addCaretListener(new javax.swing.event.CaretListener() {
            public void caretUpdate(javax.swing.event.CaretEvent evt) {
                txtFechaCaretUpdate(evt);
            }
        });

        lblFecha.setText("Fecha");

        txtHora.setColumns(10);

        lblHora.setText("Hora");

        lblRodado.setText("Rodado");

        listRodado.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        listRodado.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane3.setViewportView(listRodado);

        lblBascula.setText("Bascula");

        buttonGroup1.add(rdEntrada);
        rdEntrada.setSelected(true);
        rdEntrada.setText("Entrada");
        rdEntrada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdEntradaActionPerformed(evt);
            }
        });

        buttonGroup1.add(rbSalida);
        rbSalida.setText("Salida");
        rbSalida.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbSalidaActionPerformed(evt);
            }
        });

        lblMatPrima.setText("Materia Prima");

        lblDestino.setText("Destino");

        lblProductos.setText("Productos");

        btnNuevaBascula.setText("Nueva Bascula");

        btnNuevaMatPrima.setText("Nueva Materia Prima");

        listProductos.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        scrollListProductos.setViewportView(listProductos);

        javax.swing.GroupLayout panelAltaLayout = new javax.swing.GroupLayout(panelAlta);
        panelAlta.setLayout(panelAltaLayout);
        panelAltaLayout.setHorizontalGroup(
            panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator1)
            .addGroup(panelAltaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelAltaLayout.createSequentialGroup()
                        .addComponent(lblDestino, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtDestino, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(lblHora, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(panelAltaLayout.createSequentialGroup()
                        .addGroup(panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblRodado, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblNroCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txtNroCliente)
                            .addComponent(txtFecha)
                            .addComponent(txtHora)
                            .addComponent(jScrollPane3)))
                    .addGroup(panelAltaLayout.createSequentialGroup()
                        .addComponent(lblProductos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(scrollListProductos, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelAltaLayout.createSequentialGroup()
                        .addComponent(lblMatPrima, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnNuevaMatPrima))
                    .addGroup(panelAltaLayout.createSequentialGroup()
                        .addComponent(lblBascula, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnNuevaBascula))
                    .addGroup(panelAltaLayout.createSequentialGroup()
                        .addComponent(rdEntrada)
                        .addGap(18, 18, 18)
                        .addComponent(rbSalida)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        panelAltaLayout.setVerticalGroup(
            panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAltaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNroCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblNroCliente))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblFecha))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtHora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblHora))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblRodado)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addGroup(panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rdEntrada)
                    .addComponent(rbSalida))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblBascula)
                    .addComponent(btnNuevaBascula))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblMatPrima)
                    .addComponent(btnNuevaMatPrima))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblDestino)
                    .addComponent(txtDestino, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelAltaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblProductos)
                    .addComponent(scrollListProductos, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(30, Short.MAX_VALUE))
        );

        jScrollPane2.setViewportView(panelAlta);

        btnModificar.setText("Modificar");
        btnModificar.setEnabled(false);
        btnModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnModificarActionPerformed(evt);
            }
        });

        btnAlta.setText("Alta");
        btnAlta.setEnabled(false);
        btnAlta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAltaActionPerformed(evt);
            }
        });

        btnCancelarSeleccion.setText("Cancelar Selección");
        btnCancelarSeleccion.setEnabled(false);
        btnCancelarSeleccion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarSeleccionActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelBotonesLayout = new javax.swing.GroupLayout(panelBotones);
        panelBotones.setLayout(panelBotonesLayout);
        panelBotonesLayout.setHorizontalGroup(
            panelBotonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBotonesLayout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addComponent(btnAlta, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnCancelarSeleccion)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnModificar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        panelBotonesLayout.setVerticalGroup(
            panelBotonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBotonesLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelBotonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnModificar)
                    .addComponent(btnAlta)
                    .addComponent(btnCancelarSeleccion))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(panelTabla, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(147, 147, 147)
                        .addComponent(panelBotones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(panelTabla, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(panelBotones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnAltaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAltaActionPerformed
    }//GEN-LAST:event_btnAltaActionPerformed

    private void tblClienteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblClienteMouseClicked
        filaSeleccionada = true;
        btnModificar.setEnabled(true);
        btnCancelarSeleccion.setEnabled(true);
    }//GEN-LAST:event_tblClienteMouseClicked

    private void btnCancelarSeleccionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarSeleccionActionPerformed
        filaSeleccionada = false;
        vaciarCampos();
        btnCancelarSeleccion.setEnabled(false);
        btnModificar.setEnabled(false);
        btnAlta.setText("Alta");
    }//GEN-LAST:event_btnCancelarSeleccionActionPerformed

    private void txtFechaCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_txtFechaCaretUpdate
    }//GEN-LAST:event_txtFechaCaretUpdate

    private void btnModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnModificarActionPerformed
        llenarCampos();
        btnAlta.setText("Guardar");
    }//GEN-LAST:event_btnModificarActionPerformed

    private void rdEntradaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdEntradaActionPerformed
        if (rdEntrada.isSelected()) {
            lblProductos.setVisible(false);
            scrollListProductos.setVisible(false);
            lblDestino.setVisible(false);
            txtDestino.setVisible(false);
            lblBascula.setVisible(true);
            btnNuevaBascula.setVisible(true);
            lblMatPrima.setVisible(true);
            btnNuevaMatPrima.setVisible(true);
        }
    }//GEN-LAST:event_rdEntradaActionPerformed

    private void rbSalidaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbSalidaActionPerformed
        if (rbSalida.isSelected()) {
            lblProductos.setVisible(true);
            scrollListProductos.setVisible(true);
            lblDestino.setVisible(true);
            txtDestino.setVisible(true);
            lblBascula.setVisible(false);
            btnNuevaBascula.setVisible(false);
            lblMatPrima.setVisible(false);
            btnNuevaMatPrima.setVisible(false);
        }
    }//GEN-LAST:event_rbSalidaActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.persistence.EntityManager SecaderoPUEntityManager;
    private javax.swing.JButton btnAlta;
    private javax.swing.JButton btnCancelarSeleccion;
    private javax.swing.JButton btnModificar;
    private javax.swing.JButton btnNuevaBascula;
    private javax.swing.JButton btnNuevaMatPrima;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JLabel lblBascula;
    private javax.swing.JLabel lblDestino;
    private javax.swing.JLabel lblFecha;
    private javax.swing.JLabel lblHora;
    private javax.swing.JLabel lblMatPrima;
    private javax.swing.JLabel lblNroCliente;
    private javax.swing.JLabel lblProductos;
    private javax.swing.JLabel lblRodado;
    private javax.swing.JList listProductos;
    private javax.swing.JList listRodado;
    private javax.swing.JPanel panelAlta;
    private javax.swing.JPanel panelBotones;
    private javax.swing.JPanel panelTabla;
    private javax.swing.JRadioButton rbSalida;
    private javax.swing.JRadioButton rdEntrada;
    private javax.swing.JScrollPane scrollListProductos;
    private javax.swing.JTable tblCliente;
    private javax.swing.JTextField txtDestino;
    private javax.swing.JTextField txtFecha;
    private javax.swing.JTextField txtHora;
    private javax.swing.JTextField txtNroCliente;
    // End of variables declaration//GEN-END:variables
}
